<template>
    <view class="page" :style="themeColor">
    <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex returnInformation_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
            <view   class='flex flex-wrap align-center justify-between returnInformation_fd0_0'     >
            <view   class='flex flex-wrap align-center returnInformation_fd0_0_c0'  @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  returnInformation_fd0_0_c0_c0' >&#xE794;</text>
</view>
    <view   class='flex flex-wrap align-center'     >
        <text class='returnInformation_fd0_0_c1_c0' >填写寄回信息</text>
</view>
    <view   class='flex align-center justify-end returnInformation_fd0_0_c2'     >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---售后订单flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout returnInformation_flex_1"   >
            <view   class='flex flex-wrap align-stretch'     >
        <image class='returnInformation_fd1_0_c0' mode="aspectFit"  :src='goodsInfo.goods_thumb'></image>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub returnInformation_fd1_0_c1'     >
        <text class='returnInformation_fd1_0_c1_c0' >{{goodsInfo.goods_name}}</text>
<text class='returnInformation_fd1_0_c1_c1' >{{goodsInfo.sku_name}}</text>
    <view   class='flex flex-wrap align-center justify-between'     >
            <view   class='flex flex-wrap align-center'     >
        <text class='returnInformation_fd1_0_c1_c2_c0_c0' >￥</text>
<view class=' returnInformation_fd1_0_c1_c2_c0_c1'  >
    <text class=' returnInformation_price1_fd1_0_c1_c2_c0_c1'>{{ goodsInfo.goods_money | frontPrice }}</text>
    <text class=' returnInformation_price2_fd1_0_c1_c2_c0_c1'>{{ goodsInfo.goods_money | laterPrice }}</text>
</view>
</view>
    <view   class='flex flex-wrap align-center returnInformation_fd1_0_c1_c2_c1'     >
        <text  >x</text>
<text  >{{goodsInfo.goods_num}}</text>
</view>
</view>
</view>
</view>
</view>
<!---售后订单flex布局结束-->
<!---填写寄回信息flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout returnInformation_flex_2"   >
            <view   class='flex flex-wrap align-center returnInformation_fd2_0'  @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/wode/chooseLogisticsCompany/chooseLogisticsCompany`"   >
        <text class='returnInformation_fd2_0_c0' >物流公司</text>
<input class='flex-sub returnInformation_fd2_0_c1'  type="text" placeholder="请选择" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#999;font-size:32rpx"  v-model="logistics.logistics_name" />
<text class='fu-iconfont2  returnInformation_fd2_0_c2' >&#xe7f2;</text>
</view>
    <view   class='flex flex-wrap align-center returnInformation_fd2_1'     >
        <text class='returnInformation_fd2_1_c0' >物流单号</text>
<input class='flex-sub returnInformation_fd2_1_c1'  type="text" placeholder="请填写物流单号" confirm-type="done" :maxlength="-1" placeholder-style="color:#999;font-size:32rpx"  v-model="express_no" />
</view>
    <view   class='flex flex-wrap align-center returnInformation_fd2_2'     >
        <text class='returnInformation_fd2_2_c0' >联系电话</text>
<input class='flex-sub returnInformation_fd2_2_c1'  type="number" placeholder="请输入联系电话" confirm-type="done" :maxlength="11" placeholder-style="color:#999;font-size:32rpx"  v-model="mobile" />
</view>
    <view   class='flex flex-wrap align-center returnInformation_fd2_3'     >
        <text class='returnInformation_fd2_3_c0' >退换说明</text>
<input class='flex-sub returnInformation_fd2_3_c1'  type="text" placeholder="请输入(选填)" confirm-type="done" :maxlength="-1" placeholder-style="color:#999;font-size:32rpx"  v-model="content" />
</view>
    <benben-images-upload  ref="benbenImagesUploadfd2_4"  :img-list.sync="url" :img-ids.sync="images" :maxlength="9" >
    <template #content="{ num, maxlength, isShow, imgList }">
     <view class="flex flex-wrap align-start flex returnInformation_fd2_4">
            
    <view v-for="(image, index) in imgList" :key="index"  class='flex position-relative returnInformation_fd2_40'     >
        <text class='fu-iconfont2 position-absolute returnInformation_fd2_400'  @tap.stop="$refs.benbenImagesUploadfd2_4.delImage(index)">&#xE8E7;</text><image class='returnInformation_fd2_401' @tap.stop="$refs.benbenImagesUploadfd2_4.previewImage(index)"  :src='image'></image>
    </view>
    
            <image class='returnInformation_fd2_41' @tap.stop="$refs.benbenImagesUploadfd2_4.manyChooseImage()"  v-if="isShow" mode="aspectFit"  :src='STATIC_URL+"49.jpg"'></image>
            
          </view>
        </template>
    </benben-images-upload>
</view>
<!---填写寄回信息flex布局结束-->
    <view class="flex flex-wrap align-center justify-center benben-position-layout flex returnInformation_flex_3"    >
        <button class='returnInformation_fd3_0' @tap.stop="postMessageFunc()"  >提交</button>

        </view>
<view :style="{height: '88rpx'}"  ></view>
    
    
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    export default {
        components:{},
        
        
        data(){
			return {"express_no":"","mobile":"","content":"","images":"","url":[],"logistics":{"logistics_id":"","logistics_name":""},"goodsInfo":{"aid":"","server_no":"","order_sn":"","goods_name":"","num":"","goods_id":"","refund_reason":"","sku_id":"","user_nickname":"","goods_money":"","refund_money":"","user_id":"","refund_type":"","refund_pay_type":"","create_time":"","refund_content":"","refund_picture":[],"refund_time":"","express_no":"","refund_reject":"","receiver_mobile":"","receiver_address":"","receiver_name":"","cancel_time":"","status":"","buyer_contact":"","buyer_instructions":"","buyer_instruction_picture":"","goods_thumb":"","sku_name":"","goods_num":""},"aid":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {aid}=options
if (aid !== undefined) this.aid = aid
this.pageDataFunc()
this.diyPageListen()
		},
        onUnload() {
            this.diyOffPageListen()    
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //提交寄回信息
                async postMessageFunc(){
                                if(!validate(this.express_no,'require')){
                 this.$message.info('请填写买家发货运单号');
                 return false;
            }
            if(!validate(this.logistics.logistics_id,'require')){
                 this.$message.info('请选择物流公司');
                 return false;
            }
            if(!validate(this.mobile,'require')){
                 this.$message.info('请填写联系方式');
                 return false;
            }
    //请求方法
    //数据验证
    
  let data62ce899de231b = await this.$api.get(global.apiUrls.post62ce899de231b, {
    aid:this.aid,express_no:this.express_no,express_company_id:this.logistics.logistics_id,buyer_contact:this.mobile,buyer_instructions:this.content,buyer_instruction_picture:this.images
  });
  if (data62ce899de231b.data.code != 1) {
    this.$message.info(data62ce899de231b.data.msg);
    return
  } 
  
  
                    this.$message.info('提交成功');
                setTimeout(()=>{
                    uni.navigateBack({
              delta:1
            });
      },500)
                },
                //获取页面信息
                async pageDataFunc(){
                        //请求方法
    //数据验证
    
  let datagoodsInfo = await this.$api.get(global.apiUrls.post62ce8551841b8, {
    aid:this.aid
  });
  if (datagoodsInfo.data.code != 1) {
    this.$message.info(datagoodsInfo.data.msg);
    return
  } 
  let infogoodsInfo = datagoodsInfo.data;
  this.goodsInfo = infogoodsInfo.data
                },
    //页面监听
    diyPageListen() {
                  uni.$on('logistics',(data) => {
                  this.logistics = data;
          });
    }                     ,
    //注销页面监听
    diyOffPageListen() {
                     uni.$off('logistics');
    }                     
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#fff;background-size: 100% auto !important;
        }
    .returnInformation_flex_0{
        background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .returnInformation_fd0_0_c2{
        padding:0rpx 0rpx 0rpx 0rpx;width:200rpx;
    }
    .returnInformation_fd0_0_c1_c0{
        font-size:36rpx;font-weight:500;color:#333333;
    }
    .returnInformation_fd0_0_c0_c0{
        font-size:36rpx;color:#333;font-weight:500;
    }
    .returnInformation_fd0_0_c0{
        width:200rpx;
    }
    .returnInformation_fd0_0{
        padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;
    }
    .returnInformation_flex_1{
        padding:0rpx 24rpx 0rpx 24rpx;
    }
    .returnInformation_fd1_0_c1_c2_c1{
        font-size:24rpx;font-weight:400;color:#999999;
    }
    .returnInformation_price2_fd1_0_c1_c2_c0_c1{
        font-size:22rpx;
    }
    .returnInformation_price1_fd1_0_c1_c2_c0_c1{
        font-size:32rpx;
    }
    .returnInformation_fd1_0_c1_c2_c0_c1{
        color:#ff5536;font-weight:600;
    }
    .returnInformation_fd1_0_c1_c2_c0_c0{
        font-size:20rpx;font-weight:700;color:#FF4133;
    }
    .returnInformation_fd1_0_c1_c1{
        font-size:24rpx;font-weight:400;color:#999999;margin:10rpx 0rpx 36rpx 0rpx;
    }
    .returnInformation_fd1_0_c1_c0{
        font-size:28rpx;font-weight:500;color:#333333;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .returnInformation_fd1_0_c1{
        margin:0rpx 0rpx 0rpx 34rpx;
    }
    .returnInformation_fd1_0_c0{
        width:200rpx;height:200rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .returnInformation_flex_2{
        padding:15rpx 24rpx 0rpx 24rpx;
    }
    .returnInformation_fd2_41{
        width:160rpx;height:160rpx;margin:0rpx 24rpx 24rpx 0rpx;border-radius:20rpx 20rpx 20rpx 20rpx;
    }
    .returnInformation_fd2_401{
        width:160rpx;height:160rpx;border-radius:20rpx 20rpx 20rpx 20rpx;
    }
    .returnInformation_fd2_400{
        top:0rpx;right:0rpx;z-index:10;color:#ff5536;
    }
    .returnInformation_fd2_40{
        margin:0rpx 24rpx 24rpx 0rpx;
    }
    .returnInformation_fd2_4{
        width:100%;padding:24rpx 0rpx 0rpx 24rpx;
    }
    .returnInformation_fd2_3_c1{
        height:109rpx;font-size:32rpx;font-weight:500;color:#333;text-align:right;
    }
    .returnInformation_fd2_3_c0{
        font-size:32rpx;font-weight:400;color:#111111;
    }
    .returnInformation_fd2_3{
        border-bottom:1px solid #eee;font-weight:400;font-size:32rpx;color:#333;
    }
    .returnInformation_fd2_2_c1{
        font-size:32rpx;font-weight:500;color:#333;text-align:right;height:109rpx;
    }
    .returnInformation_fd2_2_c0{
        font-size:32rpx;font-weight:400;color:#111111;
    }
    .returnInformation_fd2_2{
        border-bottom:1px solid #eee;
    }
    .returnInformation_fd2_1_c1{
        height:109rpx;font-size:32rpx;font-weight:500;color:#333;text-align:right;
    }
    .returnInformation_fd2_1_c0{
        font-size:32rpx;font-weight:400;color:#111111;
    }
    .returnInformation_fd2_1{
        border-bottom:1px solid #eee;
    }
    .returnInformation_fd2_0_c2{
        font-size:16rpx;font-weight:400;color:rgba(191, 191, 191, 1);margin:0rpx 0rpx 0rpx 20rpx;
    }
    .returnInformation_fd2_0_c1{
        height:109rpx;font-size:32rpx;font-weight:400;color:rgba(51, 51, 51, 1);text-align:right;
    }
    .returnInformation_fd2_0_c0{
        font-size:32rpx;font-weight:400;color:#111111;
    }
    .returnInformation_fd2_0{
        border-bottom:1px solid #eee;
    }
    .returnInformation_flex_3{
        width:750rpx;height:88rpx;overflow:hidden;z-index:10;bottom:calc(40rpx + var(--window-bottom));
    }
    .returnInformation_fd3_0{
        background:#40833E;border-radius:100rpx 100rpx 100rpx 100rpx;font-size:32rpx;color:#fff;width:686rpx;height:88rpx;line-height:88rpx;font-weight:500;
    }
</style>